package cn.hinglo.permission.validator;

import cn.hinglo.common.validator.BaseValidator;
import com.jfinal.core.Controller;

/**
 * @createTime: 2018/3/7
 * @author: HingLo
 * @description: 参数验证的基类，可以写一些公用的校验
 */
public class AddUserValidator extends BaseValidator {

    @Override
    protected void validate(Controller c) {
        validateRequiredString("username", "username", "用户名编号不能为空");
        validateRequiredString("password", "password", "用户名密码不能为空");
        validateMinLength("username", 6, "username", "用户名最小为6位");
        validateMinLength("password", 6, "password", "用户名最小为6位");
        validateLong("roleId", "roleId", "指定的角色不能为空");
    }
}



